package org.jackysoft.portal.google.collection;

import org.jackysoft.entity.nosql.NewsCatalog;
import org.jackysoft.google.collection.AbstractZTreeFunction;
import org.jackysoft.google.collection.ZTreeNode;

public class NewsCatalogZtreeFunction extends
		AbstractZTreeFunction<NewsCatalog, ZTreeNode> {

	@Override
	public ZTreeNode apply(NewsCatalog from) {
		
		ZTreeNode zn = new ZTreeNode();
		zn.setId(from.getId());
		zn.setName(from.getName());
		zn.setSort(from.getSort());	
		zn.setIsParent(!from.isLeaf()+"");
		return zn;
	}

}